package codingforgreat.lchot150;

public class Lc011 {
    public int maxArea(int[] height) {
        int L = 0;
        int R = height.length - 1;
        int res = 0;
        while(L <= R ){
            res = Math.max(Math.min(height[L],height[R]) * (R - L),res);
            if(height[L]<=height[R]){
                L++;
            }else{
                R--;
            }
        }
        return res;
    }
}
